<template>
  <div class="login-container">
    <div class="login-b">
      <h1>黄金珠宝进销存系统</h1>

      <div class="login_box">
        <!-- 登陆表单 -->
        <nav>
 
          <p @click="dom = 'AdminLogin'" :class="{ on: dom == 'AdminLogin' }">
            使用管理员身份登录
          </p>
   
    
          <p @click="dom = 'UserLogin'" :class="{ on: dom == 'UserLogin' }">
            使用员工身份登录
          </p>
     
        </nav>

        <!-- 组件缓存 -->
        <keep-alive include="AdminLogin" >
     
            <component :is="dom"></component>

        </keep-alive>
      </div>
    </div>
  </div>
</template>

<script>
//登陆请求

import AdminLogin from '../components/login/AdminLogin'
import UserLogin from '../components/login/UserLogin'


export default {
  name:"login",
  components:{
    AdminLogin,
    UserLogin
  },
  data() {
    return {
      dom: 'AdminLogin'
    }
  }



}
</script>

<style lang="less" scoped>
.login-container {
  width: 100%;
  height: 100%;
  .login-b {
    box-sizing: border-box;
    background: url(../assets/beijing.jpg) 100% 100%;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100vh;
    background-size: 100% 100%;
    background-position: top center;
    background-attachment: fixed;
  }
}

.login_box {
  width: 450px;
  height: 300px;
  background-color: rgba(255, 255, 255, 0.829);
  border-radius: 3px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  nav {
    margin-top: 10px;
    height: 40px;

    p {
      float: left;
      width: 225px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      cursor: pointer;
     
      
    }
    
  }
  .on {
    color: #967312;
    
    // .on::after{
    //   content: '';
    //   position: absolute;
    //   top: 60px;
    //   left: 40px;
    //   width: 145px;
    //   border-bottom: 1px #967312 solid;
    // }

  }
  
  .on::after{
      content: '';
      position: absolute;
      top: 60px;
      left: 40px;
      width: 145px;

    
  }

}
h1 {
  width: 450px;
  height: 400px;
  position: absolute;
  left: 50%;
  top: 50%;
  text-align: center;
  transform: translate(-50%, -75%);
  font-size: 50px;
  color: rgb(255, 166, 0);
}

</style>